import request from '@/router/axios';

// 列表分页
export const getPageList = (params) => {
  return request({
    url: '/api/mes-admin/page-area/page',
    method: 'get',
    params: {
      type: 'PAGE',
      ...params
    }
  });
};

export const getChild = (params) => {
  return request({
    url: '/api/mes-admin/page-area/list',
    method: 'get',
    params
  });
};

// 获取所属模块
export const getPageModel = (menuId) => {
  return request({
    url: '/api/blade-system/menu/get-root-menu',
    method: 'get',
    params: {
      menuId
    }
  });
};

export const submit = (data) => {
  return request({
    url: '/api/mes-admin/page-area/submit',
    method: 'POST',
    data
  });
};

export const remove = (data) => {
  return request({
    url: '/api/mes-admin/page-area/remove',
    method: 'POST',
    params: {
      ...data
    }
  });
};
